package com.rentong.wx.utils;

import java.util.Calendar;
import java.util.Date;

public class DateUtils {

    //把日期增加几个月
    public static Date getDateForMonths(Date currentDate, Integer num) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(currentDate);
        calendar.add(Calendar.MONTH, num);

        return calendar.getTime();
    }

    //把日期增加几天
    public static Date getDateForDays(Date currentDate, Integer num) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(currentDate);
        calendar.add(Calendar.DAY_OF_MONTH, num);

        return calendar.getTime();
    }




}
